/**
 * 
 */
package com.careerraiser.testing;

import com.careerraiser.child.Cat;
import com.careerraiser.child.DoberMan;
import com.careerraiser.child.Dog;
import com.careerraiser.child.SoundMaker;
import com.careerraiser.parent.Animal;


/**
 * @author Lenovo
 *
 */
public class Constructortest {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
	//	com.careerraiser.xtra.Dog dog1 =new com.careerraiser.xtra.Dog();
	//	com.careerraiser.child.Dog dog2 = new com.careerraiser.child.Dog();
		String animaltype=args[0];
		System.out.println("before constructor call");
		Animal dobrman1=getAnimalObject(animaltype);
		SoundMaker dobrman11=new DoberMan("dob2");
		dobrman11.makeSound();
		dobrman1.makeSound();
		Cat cat1=new Cat();
		String result=dobrman1.getName();
		System.out.println(result);
		cat1.getName();
		
		//DoberMan dobrman2=new DoberMan("dob2", 40,100);
		//DoberMan dobrman3=new DoberMan("dob3", 40,100);
		//DoberMan dobrman3=dobrman2;
		System.out.println("after constructor call");
		int counter=0;
		//dobrman2=null;
		//dobrman3=null;
		

	}

	private static Animal getAnimalObject(String xyz) {
		if(xyz.equals("CAT")){
			System.out.println("returning CAT");
			return new Cat();
		}else{
			System.out.println("returning DOG");
			Dog abcd=new Dog();
			return abcd;
		}
	}

}
